package cn.justforchris.blog.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 文章类型实体类
 */
@Data
public class ArticleType {
    private Long id;
    private String typeName;
    private Integer status;
    @JsonFormat(pattern = "yy-MM-dd HH-mm",timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yy-MM-dd",timezone = "GMT+8")
    private Date updateTime;
    private Long parentId;

    private String parentName;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<ArticleType> children=new ArrayList<>();
    /*这个是用来存放对象的子类型对象,此注解的效果是当children为空时,不返回children属性,
    注意,这个变量名是前端代码决定的,在前端代码中elementUI使用的是children为变量名*/
}
